package service.impl;

import dao.ITeacherDao;
import dao.impl.TeacherDao;
import domain.Teacher;
import service.ITeacherService;

import java.util.List;

public class TeacherService implements ITeacherService {
    //父类的引用指向子类的对象

    ITeacherDao teacherDao = new TeacherDao();

    @Override
    public boolean login(String workno, String pwd) {
        //1、根据参数查询老师记录
        boolean flag = teacherDao.selectTeacher(workno,pwd);
        //如果教师实例不为空，则信息存在，否则不存在
        return flag;
    }
    //查询管理员
    public List selectManagers() {
        return teacherDao.selectManagers();
    }

    //添加管理员
    public int insertManager(Teacher teacher) {
        return teacherDao.insertManager(teacher);
    }
    //删除管理员
    public String deleteManager(String num){
        return teacherDao.deleteManager(num);
    }

}